Skip to content

Conversation

@jimyu-baxenergy
Copy link

We found that that using the current version of uvloop with accelerated pproxy now results in the following error.

pproxy -1 http://0.0.0.0:7074 -r socks5://localhost:1080
Using uvloop
Traceback (most recent call last):
File "/Users/jimyu/experiments/pproxy/venv/bin/pproxy", line 7, in ‹module> sys. exit(main())
NUNNAA
File "/Users/jimyu/experiments/pproxy/venv/lib/python3.13/site-packages/pproxy/server.py", line 951,
in main
loop = asyncio.get_event_loop()
File "/Users/jimyu/experiments/pproxy/venv/lib/python3.13/site-packages/uvloop/__init__.py", line 206, in get_event_loop raise RuntimeError
...<2 lines>...
RuntimeError: There is no current event loop in thread 'MainThread'.

This PR fixes this error by explicitly creating a new event loop in server.py when uvloop is able to be imported and using the regular event loop otherwise.

@ferrari-openai
Copy link

Nice! Also ran into this issue! Could be convenient to have a flag to force disable uvloop in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants